import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit'
import counterReducer from '../features/counter/counterSlice'
import loginReducer from 'views/login/loginSlice'

export const store = configureStore({
  reducer: {
    login: loginReducer,
    counter: counterReducer,
  },
})

export type AppDispatch = typeof store.dispatch
// 数据仓库注解
export type RootState = ReturnType<typeof store.getState>
// thunk注解
export type AppThunk<ReturnType = void> = ThunkAction<ReturnType, RootState, unknown, Action<string>>
